/*
 * CVideoRender.h
 *
 *  Created on: 2017年3月16日
 *      Author: chuanjiang.zh
 */

#ifndef CVIDEORENDER_H_
#define CVIDEORENDER_H_

#include "VideoRender.h"
#include "MediaFrame.h"
#include "TimePoint.h"
#include "SdlVideoWindow.h"


namespace av
{

class CVideoRender: public VideoRender
{
public:
	CVideoRender();
	virtual ~CVideoRender();

	virtual int create(void* hwnd);

	virtual void destroy();

	virtual int open(const MediaFormat& fmt);

	virtual void close();

	virtual bool isOpen();

	virtual int play();
	virtual int pause();
	virtual void stop();

	virtual int getState();

	virtual int write(AVFrame* frame);

	virtual void flush();


	virtual int setRatio(int width, int height);

	virtual void setVisible(bool visible);

protected:
	void setState(StreamState state);

protected:
	comn::CriticalSection	m_cs;

	TimePoint	m_timePoint;

	SdlVideoWindow	m_window;

	StreamState	m_state;

};



} /* namespace av */

#endif /* CVIDEORENDER_H_ */
